#include <gtest/gtest.h>
#include "jkutil/errformat.h"

TEST(errformatTest, intval)
{
    std::string ret = Util::errparam(1, 2, 3);
    ASSERT_STREQ(ret.c_str(), "#{\"fixed_key\":[\"1\",\"2\",\"3\"]}");
}
TEST(errformatTest, doubleval)
{
    std::string ret = Util::errparam(1.1, 2.2, 3.3);
    ASSERT_STREQ(ret.c_str(), "#{\"fixed_key\":[\"1.1\",\"2.2\",\"3.3\"]}");
}
TEST(errformatTest, stringval)
{
    std::string ret = Util::errparam("vv", "aa", "a3");
    ASSERT_STREQ(ret.c_str(), "#{\"fixed_key\":[\"vv\",\"aa\",\"a3\"]}");
}
TEST(errformatTest, mixval)
{
    std::string ret = Util::errparam(1, 2.2, "a3");
    ASSERT_STREQ(ret.c_str(), "#{\"fixed_key\":[\"1\",\"2.2\",\"a3\"]}");
}